//
//  ViewController.m
//  XPCStudy
//
//  Created by  JasonLee on 2021/9/9.
//

#import "ViewController.h"
#import "XPCSericeProtocol.h"
@interface ViewController()
{
    NSXPCConnection * _connect;
}
@end
@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _connect = [[NSXPCConnection alloc] initWithServiceName:@"com.111.111.XPCServer"];
    _connect.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:(@protocol(XPCSericeProtocol))];
    [_connect resume];
    
    [[_connect remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
                NSLog(@"%@",error);
    }] upperCaseString:@"eric" withReply:^(NSString *result) {
        NSLog(@"xpc 返回了 结果是: %@", result);

    }] ;
    NSLog(@"检测是否卡进程");
    
    // Do any additional setup after loading the view.
}

- (void)setRepresentedObject:(id)representedObject {
    [super setRepresentedObject:representedObject];

    // Update the view, if already loaded.
}


@end
